package com.golxen.framework.event.condition;


import com.golxen.framework.event.condition.dao.entity.UserConditionData;
import com.golxen.framework.log.LogMgr;
import com.golxen.framework.user.player.GamePlayer;
import com.golxen.utils.TimeUtils;
import com.mysql.cj.util.LogUtils;

import java.math.BigInteger;

public class UserBaseCondition {

	protected BaseCondition baseCondition;

	private UserConditionData userConditionData;

	protected GamePlayer player;

	public UserBaseCondition(BaseCondition baseCondition, UserConditionData userConditionData, GamePlayer player) {
		super();
		this.baseCondition = baseCondition;
		this.userConditionData = userConditionData;
		this.player = player;
	}

	public UserConditionData getUserTaskData() {
		return userConditionData;
	}

	public void addTrigger() {
		if (null != baseCondition) {
			baseCondition.addTrigger(player);
		}
	}

	public void removeTrigger() {
		if (null != baseCondition) {
			baseCondition.removeTrigger(player);
		}
	}

	public final boolean canCompleted() {

		if(null != baseCondition) {
			return baseCondition.isCompleted(player);
		}
		return true;
	}


	public GamePlayer getGamePlayer() {
		return player;
	}

	public BaseCondition getBaseCondition() {
		return baseCondition;
	}

	public void setBaseCondition(BaseCondition baseCondition) {
		this.baseCondition = baseCondition;
	}
}
